home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / sun / misc / SoftCache$ValueCell.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  1.3 KB  |  69 lines

  1. package sun.misc;
  2.  
  3. import java.lang.ref.ReferenceQueue;
  4. import java.lang.ref.SoftReference;
  5.  
  6. class SoftCache$ValueCell extends SoftReference {
  7.    private static Object INVALID_KEY = new Object();
  8.    private static int dropped = 0;
  9.    private Object key;
  10.  
  11.    private SoftCache$ValueCell(Object var1, Object var2, ReferenceQueue var3) {
  12.       super(var2, var3);
  13.       this.key = var1;
  14.    }
  15.  
  16.    private static SoftCache$ValueCell create(Object var0, Object var1, ReferenceQueue var2) {
  17.       return var1 == null ? null : new SoftCache$ValueCell(var0, var1, var2);
  18.    }
  19.  
  20.    private static Object strip(Object var0, boolean var1) {
  21.       if (var0 == null) {
  22.          return null;
  23.       } else {
  24.          SoftCache$ValueCell var2 = (SoftCache$ValueCell)var0;
  25.          Object var3 = var2.get();
  26.          if (var1) {
  27.             var2.drop();
  28.          }
  29.  
  30.          return var3;
  31.       }
  32.    }
  33.  
  34.    private boolean isValid() {
  35.       return this.key != INVALID_KEY;
  36.    }
  37.  
  38.    private void drop() {
  39.       super.clear();
  40.       this.key = INVALID_KEY;
  41.       ++dropped;
  42.    }
  43.  
  44.    // $FF: synthetic method
  45.    static boolean access$000(SoftCache$ValueCell var0) {
  46.       return var0.isValid();
  47.    }
  48.  
  49.    // $FF: synthetic method
  50.    static Object access$100(SoftCache$ValueCell var0) {
  51.       return var0.key;
  52.    }
  53.  
  54.    // $FF: synthetic method
  55.    static int access$210() {
  56.       return dropped--;
  57.    }
  58.  
  59.    // $FF: synthetic method
  60.    static Object access$300(Object var0, boolean var1) {
  61.       return strip(var0, var1);
  62.    }
  63.  
  64.    // $FF: synthetic method
  65.    static SoftCache$ValueCell access$400(Object var0, Object var1, ReferenceQueue var2) {
  66.       return create(var0, var1, var2);
  67.    }
  68. }
  69.